#include "mainwidget.h"
#include "ui_mainwidget.h"
#include "iewidget.h"
#include "musicWidget.h"
#include "control.h"
#include "mymapwidget.h"

MainWidget::MainWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MainWidget)
{
    ui->setupUi(this);
    this->setWindowFlags(Qt::FramelessWindowHint|Qt::WindowSystemMenuHint);
}

MainWidget::~MainWidget()
{
    delete ui;
}

void MainWidget::paintEvent(QPaintEvent *event){
    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget,&opt,&p,this);
    QWidget::paintEvent(event);

}
void MainWidget::on_mapButton_clicked()
{
    MyMapWidget *mmw = new MyMapWidget();
    mmw->show();
    mmw->setGeometry(this->geometry());
}

void MainWidget::on_musicButton_clicked()
{
    MusicWidget *mw = new MusicWidget();
    mw->show();
    mw->setGeometry(this->geometry());
}

void MainWidget::on_ieButton_clicked()
{
    IeWidget *ie = new IeWidget();
    ie->show();
    ie->setGeometry(this->geometry());
}

void MainWidget::on_controlButton_clicked()
{
    control *cotrl = new control();
    cotrl->show();
    cotrl->setGeometry(this->geometry());
}

void MainWidget::on_videoButton_clicked()
{
    VideoWidget *vw = new VideoWidget();
    vw->show();
    vw->setGeometry(this->geometry());
}

void MainWidget::on_closeButton_clicked()
{
    this->close();
}

void MainWidget::on_weatherButton_clicked()
{
    WeatherDialog *wd = new WeatherDialog();
    wd->show();
    wd->setGeometry(this->geometry());
}
